[XEN] Don't let the tools take away all of a domain's vcpus.
authorTim Deegan <Tim.Deegan@xensource.com>
Fri, 9 Mar 2007 12:16:21 +0000 (12:16 +0000)
committerTim Deegan <Tim.Deegan@xensource.com>
Fri, 9 Mar 2007 12:16:21 +0000 (12:16 +0000)
Signed-off-by: Weidong Han <weidong.han@intel.com>
xen/common/domctl.c

index 3a45586d65c1d9a08fdf6204b68df16b2297f5b4..b765964cb1aa34222079d0211c3a300308ac1a00 100644 (file)
@@ -360,7 +360,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
         unsigned int i, max = op->u.max_vcpus.max, cpu;
 
         ret = -EINVAL;
-        if ( max > MAX_VIRT_CPUS )
+        if ( max > MAX_VIRT_CPUS || max == 0 )
             break;
 
         ret = -ESRCH;